/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package validate;

import model.Firma;
import org.springframework.util.StringUtils;
import org.springframework.validation.Errors;

/**
 *
 * @author tomasz
 */
public class FirmaValidate {
 
    
     public void validate(Firma firma, Errors errors) {
        
                
		if (!StringUtils.hasLength(firma.getCity())) {
			errors.rejectValue("name", "name_firma", "required");
		}
                
		if (!StringUtils.hasLength(firma.getCity())) {
			errors.rejectValue("city", "required", "required");
		}
                
                if (!StringUtils.hasLength(firma.getEmail())) {
			errors.rejectValue("email", "required", "required");
		}
                
	
	}
    
     
    
}
